The invention relates to extending functionality at run-time to computer program objects.
Conventional software applications make use of independent modular software components, sometimes referred to as xe2x80x9cplug-insxe2x80x9d. These plug-ins provide extensibility to the functionality of the software application. Typically, when an application initially begins execution, a plug-in capable software application checks for available plug-ins and determines available functionality. In some application programs, checking for plug-ins may be performed dynamically, while the program is running. An example of a conventional software application which makes use of plug-ins is Adobe(copyright) Acrobat(copyright).
A disadvantage of plug-ins is that plug-ins typically are independent of one another and do not make use of the program code contained within other plug-ins. Interaction between plug-ins is typically managed at a higher level by the application program. As a result, while a plug-in may make use of functions contained in another plug-in, the plug-in does not include actual program code stored in another plug-in. Similarly, plug-ins are not able to modify or add to the content of one another.
An example of a component programing model is the Microsoft(copyright) Component Object Model (xe2x80x9cCOMxe2x80x9d). COM makes use of software components similar to the plug-ins described above. The software components include definitions written in an object-oriented programming (xe2x80x9cOOPxe2x80x9d) language, such as C++. A software component for COM defines one or more COM classes. Instances of COM classes are COM objects. These COM objects are used to build application programs. Typically, an application program loads one or more software components containing particular implementations of operations used within the application program. Each of the software components is compiled separately before the application program executes. At run-time the available software components are integrated. Software components in COM follow conventions allowing components to be implemented in different languages, such as C++, Pascal, or LISP. The software components add to the functionality of the application program by defining classes and methods which can in turn be used by the application program. However, like conventional plug-ins, the COM classes defined in the software components cannot modify one another. While one COM class can inherit from another COM class, COM classes are not able to alter other COM classes. As a result, the functionality provided by different COM objects is limited to whatever functionality is provided by the compiled form of the corresponding COM classes. To extend the functionality of a COM object, the software component defining that particular COM object""s COM class is typically rewritten and then recompiled. COM is described in many sources, including in Box, Don, xe2x80x9cEssential COMxe2x80x9d, Addison-Wesley Pub. Co., 1998.
The invention provides methods and apparatus implementing a technique for adding an interface to a boss object at run-time through an object manager. A boss object includes one or more interfaces and each interface has a corresponding implementation class. In general, in one aspect, the technique includes: reading a first boss class having a first interface, defined in a first software component; reading a second interface, defined in a separate second software component; and binding the second interface to the first boss class, so that instantiating the first boss class creates a first boss object including the first interface and the second interface.
In another aspect, the technique includes: providing an add-in class indicating a boss class in a separate software component, where the add-in class includes a supplemental interface which can be bound to the boss class; and indicating that a boss object includes the supplemental interface, when the boss object is queried, where the boss object is created by instantiating the boss class.
Advantages of the invention include one or more of the following. The invention provides extension of boss classes at run-time or dynamically. The invention can be used to add a new boss class, to add interfaces to a boss class, to add interfaces to a set of classes by adding the interfaces to a base class from which that set inherits, to reuse code for implementation classes provided in separate software components, to instantiate a boss class, and to query for an interface using an interface identifier.